<?php
/**
 * 主页面
 */
?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>学生信息管理</title>
</head>
<body>
<?php include 'index.php';
include 'config.php';
$id=$_GET['id'];
$sql="select * from stu where ID = '$id'";
$stmt=mysqli_query($conn,$sql);
$stu=mysqli_fetch_assoc($stmt);
?>
<h3>修改学生信息</h3>
<form action="action.php?action=edit" method="post">
<table >
    <input type="hidden" name="id" value="<?php echo $stu['id'];?>">
    <tr>
        <td>姓名</td>
        <td colspan="2"><input type="text" name="name" value="<?php echo $stu['name'];?>"></td>
    </tr>
    <tr>
        <td>年龄</td>
        <td colspan="2"><input type="text" name="age" value="<?php echo $stu['age'];?>"></td>
    </tr>
    <tr>
        <td>性别</td>
        <td><input type="radio" name="sex" value="男" <?php echo ($stu['sex']=="男")?"checked":""?>>男</td>
        <td><input type="radio" name="sex" value="女" <?php echo ($stu['sex']=="女")?"checked":""?>>女</td>
    </tr>
    <tr>
        <td>班级</td>
        <td colspan="2"><input type="text" name="class" value="<?php echo $stu['class'];?>"></td>
    </tr>
    <tr>
        <td><a href="info.php">返回</a></td>
        <td><input type="submit" value="修改"></td>
        <td><input type="reset" value="重置"></td>
    </tr>
</table>
</form>
</body>
</html>